package com.gjp.controller;

import com.gjp.bean.User;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by 郭金鹏 on 2018/5/20.
 */
@RestController
public class IndexController {

    @ApiOperation("根据用户ID查询指定用户信息")
    @ApiImplicitParam(name = "id",value = "用户唯一ID",dataType = "int",paramType = "path")
    @GetMapping("/user/{id}")
    public User getUser(@PathVariable("id") Integer id){
        User user = new User();
        user.setId(id);
        user.setUsername("张三");
        user.setPassword("123456");
        return user;
    }


}
